/**
 * Created by oneminute on 8/31/14.
 */

var program = require('commander');
var lz = require("../../lib/utils/modules")();
var fs = require('fs');
var gm = require('gm');

program
    .version('0.0.1')
    .option('-f, --file [filename]', 'The file name')
    .parse(process.argv);


var filename = __dirname + '/' + (program.file || 'test005.jpg');
var outfilename = __dirname + '/' + (program.file || 'test005.jpg') + '_resize.jpg';
var thumbfilename = __dirname + '/' + (program.file || 'test005') + '_thumb.jpg';
console.log(filename);

gm(filename).resize(480, 480).noProfile().write(outfilename, function (_err) {
    console.log("resize finished. " + _err);
    gm(filename).resize(120, 120).noProfile().write(thumbfilename, function (_err) {
        console.log("thumb finished. " + _err);
    });
});

